package ithemaday14.Test;

public class GoodsTest {
    public static void main(String[] args) {
        Goods []arr=new Goods[3];
        Goods g1=new Goods(1,"华为p40",1999,100);
        Goods g2=new Goods(2,"华为p50",2999,200);
        Goods g3=new Goods(3,"华为p60",3999,500);
        arr[0]=g1;
        arr[1]=g2;
        arr[2]=g3;
        for (int i = 0; i < arr.length; i++) {
            Goods goods=arr[i];
            System.out.println(goods.getId()+","+goods.getName()+","+goods.getPrice());
        }
    }
}
